#include <stdio.h>

double factorial(int n);

int main(void)
{
	int i;
	
	for (i = 1; i <= 5; i++)
		printf("%d! = %.0f\n", i, factorial(i));

	return 0;
}

double factorial(int n)
{
	static double f = 1.0;
	
	f *= n;

	return f;
}